function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = bbeffectivedemandmatchirf_order4.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(27, 50);
g1(1,4)=(-(T(1)*y(30)*T(66)));
g1(1,21)=(-(T(2)*params(23)*y(36)*T(73)));
g1(1,30)=(-(T(1)*y(4)*T(66)));
g1(1,35)=1;
g1(1,36)=(-(T(2)*params(23)*y(21)*T(73)));
g1(2,11)=1;
g1(2,12)=(-1);
g1(2,4)=(-params(14));
g1(2,19)=params(14)/y(27);
g1(2,21)=(-y(34));
g1(2,27)=(-(params(14)*y(19)))/(y(27)*y(27));
g1(2,34)=(-y(21));
g1(3,11)=(-(T(3)/(1-y(21))));
g1(3,21)=(-(y(11)*T(3)/((1-y(21))*(1-y(21)))));
g1(3,34)=1;
g1(4,10)=(-(T(41)*T(42)));
g1(4,11)=(-(T(42)*T(53)));
g1(4,17)=(-(T(42)*T(61)));
g1(4,21)=(-(T(42)*params(24)*T(40)*y(10)*T(4)*T(74)));
g1(4,32)=1;
g1(5,17)=1;
g1(5,46)=(-(getPowerDeriv(y(46),1-params(9),1)));
g1(6,20)=(-((-((y(35)+params(15))*(1-params(1))))/(y(20)*y(20))));
g1(6,21)=y(34);
g1(6,34)=y(21);
g1(6,35)=(-((1-params(1))/y(20)));
g1(7,4)=y(30)*y(28);
g1(7,20)=(-((-((y(35)+params(15))*params(1)))/(y(20)*y(20))));
g1(7,28)=y(30)*y(4);
g1(7,30)=y(4)*y(28);
g1(7,35)=(-(params(1)/y(20)));
g1(8,14)=y(4)*y(30)*y(25);
g1(8,4)=y(30)*y(25)*y(14);
g1(8,20)=(-((-((y(35)+params(15))*params(1)))/(y(20)*y(20))));
g1(8,25)=y(4)*y(30)*y(14);
g1(8,30)=y(4)*y(25)*y(14);
g1(8,35)=(-(params(1)/y(20)));
g1(9,13)=y(4);
g1(9,18)=(-(1+y(4)*(-(T(10)*T(62)*T(63)))));
g1(9,4)=(-(T(11)+y(4)*(-(T(10)*T(63)*T(67)))));
g1(9,19)=1;
g1(10,13)=1;
g1(10,30)=(-(params(4)+params(5)/2*2*(y(30)-1)));
g1(11,14)=1;
g1(11,30)=(-params(5));
g1(12,1)=(-(T(23)*T(20)*params(2)*T(38)*T(39)));
g1(12,10)=(-(T(23)*T(20)*params(2)*T(39)*T(45)));
g1(12,2)=(-(T(23)*T(51)));
g1(12,11)=(-(T(23)*T(56)));
g1(12,3)=(-(T(19)*T(20)*T(60)));
g1(12,5)=(-(T(23)*T(20)*params(2)*T(39)*T(72)));
g1(12,21)=(-(T(23)*T(20)*params(2)*T(39)*T(75)));
g1(12,29)=1;
g1(12,32)=(-(T(19)*T(20)*T(80)));
g1(13,27)=(-y(44));
g1(13,44)=(-y(27));
g1(14,41)=(-(y(44)*y(26)*T(77)));
g1(14,26)=(-(y(44)*T(24)));
g1(14,44)=(-(y(26)*T(24)));
g1(15,37)=(-(y(44)/y(22)));
g1(15,22)=(-((-(y(44)*(y(37)+y(40))))/(y(22)*y(22))));
g1(15,40)=(-(y(44)/y(22)));
g1(15,44)=(-((y(37)+y(40))/y(22)));
g1(16,23)=(-((1-params(16))*params(17)*T(76)/T(25)));
g1(16,6)=(-(params(16)*1/y(6)));
g1(16,26)=1/y(26);
g1(16,8)=(-((1-params(16))*params(18)*T(81)/T(26)));
g1(16,35)=(-((1-params(16))*params(18)*T(82)/T(26)));
g1(17,12)=1;
g1(17,18)=1;
g1(17,4)=params(14);
g1(17,19)=params(14)*(-(1/y(27)));
g1(17,21)=y(34);
g1(17,23)=y(35)*params(7)/2*T(76)*2*(T(25)-1);
g1(17,27)=params(14)*(-((-y(19))/(y(27)*y(27))));
g1(17,34)=y(21);
g1(17,35)=(-(1-T(27)));
g1(18,38)=(-(y(44)*(-y(42))/y(25)));
g1(18,39)=(-(y(44)*y(42)*T(65)/y(25)));
g1(18,19)=(-(y(44)*y(42)*T(69)/y(25)));
g1(18,25)=(-((-T(30))/(y(25)*y(25))));
g1(18,42)=(-(y(44)*T(29)/y(25)));
g1(18,43)=(-(y(44)*y(45)/y(25)));
g1(18,44)=(-((y(45)*y(43)+y(42)*T(29))/y(25)));
g1(18,45)=(-(y(44)*y(43)/y(25)));
g1(19,18)=params(8)*T(62);
g1(19,4)=params(8)*T(67);
g1(19,25)=(-1)/(y(25)*y(25));
g1(20,20)=(-((-params(13))/(y(20)*y(20))));
g1(20,23)=params(7)*(T(25)-1)*T(76)+T(25)*params(7)*T(76);
g1(20,41)=(-(T(33)*T(76)+T(31)*T(32)*y(44)*params(7)*T(76)));
g1(20,44)=(-(T(31)*T(32)*params(7)*(T(31)-1)));
g1(20,35)=(-(T(31)*y(44)*params(7)*(T(31)-1)*T(83)));
g1(20,47)=(-(T(31)*y(44)*params(7)*(T(31)-1)*T(84)));
g1(21,20)=(-y(35));
g1(21,24)=1;
g1(21,35)=(-(y(20)-1));
g1(22,37)=T(57);
g1(22,15)=1;
g1(22,22)=(-((-(y(37)+y(40)))/(y(22)*y(22))));
g1(22,40)=T(57);
g1(23,37)=(-(2*(y(37)+y(40))/T(35)));
g1(23,16)=1;
g1(23,22)=(-((-(T(34)*2*y(22)))/(T(35)*T(35))));
g1(23,40)=(-(2*(y(37)+y(40))/T(35)));
g1(24,15)=2*y(15);
g1(24,16)=(-1);
g1(24,31)=1;
g1(25,1)=(-params(19));
g1(25,10)=1;
g1(25,7)=(-x(it_, 1));
g1(25,48)=(-y(7));
g1(26,7)=(-params(20));
g1(26,33)=1;
g1(26,49)=(-params(21));
g1(27,9)=(-params(22));
g1(27,36)=1;
g1(27,50)=(-params(49));

end
